.class public Lcom/estrongs/android/pop/zeroconf/f;
.super Ljava/lang/Object;
.source "ServiceInfo.java"


# static fields
.field private static final o:[B


# instance fields
.field public a:Ljava/lang/String;

.field public b:Ljava/lang/String;

.field public c:Ljava/lang/String;

.field public d:I

.field public e:Ljava/lang/String;

.field public f:Ljava/net/Inet4Address;

.field public g:Ljava/net/Inet6Address;

.field public h:Ljava/lang/String;

.field public i:Ljava/lang/String;

.field public j:Ljava/lang/String;

.field public k:Ljava/lang/String;

.field private l:[B

.field private m:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "[B>;"
        }
    .end annotation
.end field

.field public n:I


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x0

    new-array v0, v0, [B

    .line 1
    sput-object v0, Lcom/estrongs/android/pop/zeroconf/f;->o:[B

    return-void
.end method

.method public constructor <init>(Ljava/lang/String;ILjava/lang/String;)V
    .locals 2

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->a:Ljava/lang/String;

    .line 3
    iput-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->b:Ljava/lang/String;

    .line 4
    iput-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->c:Ljava/lang/String;

    const/4 v1, 0x0

    .line 5
    iput v1, p0, Lcom/estrongs/android/pop/zeroconf/f;->d:I

    .line 6
    iput-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->e:Ljava/lang/String;

    .line 7
    iput-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->f:Ljava/net/Inet4Address;

    .line 8
    iput-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->g:Ljava/net/Inet6Address;

    .line 9
    iput-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->k:Ljava/lang/String;

    .line 10
    invoke-direct {p0, p1}, Lcom/estrongs/android/pop/zeroconf/f;->a(Ljava/lang/String;)V

    .line 11
    iput-object p1, p0, Lcom/estrongs/android/pop/zeroconf/f;->k:Ljava/lang/String;

    .line 12
    iput p2, p0, Lcom/estrongs/android/pop/zeroconf/f;->d:I

    .line 13
    iput-object p3, p0, Lcom/estrongs/android/pop/zeroconf/f;->e:Ljava/lang/String;

    if-eqz p3, :cond_0

    const-string p1, "."

    .line 14
    invoke-virtual {p3, p1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result p1

    if-eqz p1, :cond_0

    const/16 p1, 0x2e

    .line 15
    invoke-virtual {p3, p1}, Ljava/lang/String;->indexOf(I)I

    move-result p1

    if-lez p1, :cond_0

    .line 16
    invoke-virtual {p3, v1, p1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Lcom/estrongs/android/pop/zeroconf/f;->a:Ljava/lang/String;

    :cond_0
    return-void
.end method

.method private a(Ljava/lang/String;)V
    .locals 9

    .line 1
    invoke-virtual {p1}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v0

    const-string v1, "in-addr.arpa"

    .line 2
    invoke-virtual {v0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v2

    const-string v3, "ip6.arpa"

    const-string v4, ""

    const/4 v5, 0x0

    if-nez v2, :cond_8

    invoke-virtual {v0, v3}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_0

    goto/16 :goto_3

    :cond_0
    const-string v1, "_"

    .line 3
    invoke-virtual {v0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v2

    const/16 v3, 0x2e

    const-string v6, "."

    if-nez v2, :cond_1

    invoke-virtual {v0, v6}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_1

    .line 4
    invoke-virtual {v0, v3}, Ljava/lang/String;->indexOf(I)I

    move-result v0

    .line 5
    invoke-virtual {p1, v5, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/estrongs/android/pop/zeroconf/f;->b(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 6
    invoke-virtual {p1, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/estrongs/android/pop/zeroconf/f;->b(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_5

    .line 7
    :cond_1
    invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_2

    const-string v2, "_services"

    invoke-virtual {v0, v2}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_4

    .line 8
    :cond_2
    invoke-virtual {v0, v3}, Ljava/lang/String;->indexOf(I)I

    move-result v2

    if-lez v2, :cond_4

    .line 9
    invoke-virtual {p1, v5, v2}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v7

    add-int/lit8 v2, v2, 0x1

    .line 10
    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v8

    if-ge v2, v8, :cond_3

    .line 11
    invoke-virtual {v0, v2}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v8

    .line 12
    invoke-virtual {p1, v2}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object p1

    goto :goto_0

    :cond_3
    move-object v8, v0

    goto :goto_0

    :cond_4
    move-object v8, v0

    move-object v7, v4

    :goto_0
    const-string v2, "._"

    .line 13
    invoke-virtual {v8, v2}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v2

    if-lez v2, :cond_5

    add-int/lit8 v2, v2, 0x2

    .line 14
    invoke-virtual {v8, v3, v2}, Ljava/lang/String;->indexOf(II)I

    move-result v3

    .line 15
    invoke-virtual {p1, v2, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v2

    goto :goto_1

    :cond_5
    move-object v2, v4

    .line 16
    :goto_1
    invoke-virtual {v2}, Ljava/lang/String;->length()I

    move-result v3

    if-lez v3, :cond_6

    .line 17
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v8, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    .line 18
    invoke-virtual {v2}, Ljava/lang/String;->length()I

    move-result v1

    add-int/2addr v1, v0

    add-int/lit8 v1, v1, 0x2

    .line 19
    invoke-virtual {v8}, Ljava/lang/String;->length()I

    move-result v3

    invoke-virtual {v8, v6}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v6

    sub-int/2addr v3, v6

    .line 20
    invoke-virtual {p1, v1, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v1

    add-int/lit8 v0, v0, -0x1

    .line 21
    invoke-virtual {p1, v5, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    goto :goto_2

    :cond_6
    move-object v1, v4

    .line 22
    :goto_2
    invoke-virtual {v0}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v3

    const-string v6, "._sub"

    invoke-virtual {v3, v6}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v3

    if-lez v3, :cond_7

    add-int/lit8 v4, v3, 0x5

    .line 23
    invoke-virtual {v0, v5, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lcom/estrongs/android/pop/zeroconf/f;->b(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    .line 24
    invoke-virtual {v0, v4}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-object v0, v1

    move-object v4, v2

    move-object v1, v7

    goto :goto_6

    :cond_7
    move-object v0, v1

    move-object v3, v4

    move-object v1, v7

    move-object v4, v2

    goto :goto_6

    .line 25
    :cond_8
    :goto_3
    invoke-virtual {v0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_9

    invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    goto :goto_4

    :cond_9
    invoke-virtual {v0, v3}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    .line 26
    :goto_4
    invoke-virtual {p1, v5, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/estrongs/android/pop/zeroconf/f;->b(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 27
    invoke-virtual {p1, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v0

    :goto_5
    move-object v3, v4

    .line 28
    :goto_6
    iput-object p1, p0, Lcom/estrongs/android/pop/zeroconf/f;->c:Ljava/lang/String;

    .line 29
    invoke-static {v0}, Lcom/estrongs/android/pop/zeroconf/f;->b(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Lcom/estrongs/android/pop/zeroconf/f;->h:Ljava/lang/String;

    .line 30
    iput-object v4, p0, Lcom/estrongs/android/pop/zeroconf/f;->i:Ljava/lang/String;

    .line 31
    iput-object v1, p0, Lcom/estrongs/android/pop/zeroconf/f;->b:Ljava/lang/String;

    .line 32
    iput-object v3, p0, Lcom/estrongs/android/pop/zeroconf/f;->j:Ljava/lang/String;

    return-void
.end method

.method private a(Lcom/estrongs/android/pop/zeroconf/f;)Z
    .locals 3

    const/4 v0, 0x0

    if-nez p1, :cond_0

    return v0

    .line 35
    :cond_0
    iget v1, p0, Lcom/estrongs/android/pop/zeroconf/f;->d:I

    iget v2, p1, Lcom/estrongs/android/pop/zeroconf/f;->d:I

    if-ne v1, v2, :cond_1

    iget-object v1, p0, Lcom/estrongs/android/pop/zeroconf/f;->e:Ljava/lang/String;

    iget-object p1, p1, Lcom/estrongs/android/pop/zeroconf/f;->e:Ljava/lang/String;

    invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_1

    const/4 v0, 0x1

    :cond_1
    return v0
.end method

.method private static b(Ljava/lang/String;)Ljava/lang/String;
    .locals 3

    if-nez p0, :cond_0

    const-string p0, ""

    return-object p0

    .line 1
    :cond_0
    invoke-virtual {p0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object p0

    const-string v0, "."

    .line 2
    invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    const/4 v2, 0x1

    if-eqz v1, :cond_1

    .line 3
    invoke-virtual {p0, v2}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object p0

    :cond_1
    const-string v1, "_"

    .line 4
    invoke-virtual {p0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_2

    .line 5
    invoke-virtual {p0, v2}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object p0

    .line 6
    :cond_2
    invoke-virtual {p0, v0}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_3

    const/4 v0, 0x0

    .line 7
    invoke-virtual {p0}, Ljava/lang/String;->length()I

    move-result v1

    sub-int/2addr v1, v2

    invoke-virtual {p0, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object p0

    :cond_3
    return-object p0
.end method

.method private d()[B
    .locals 2

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->l:[B

    if-eqz v0, :cond_0

    array-length v1, v0

    if-lez v1, :cond_0

    goto :goto_0

    :cond_0
    sget-object v0, Lcom/estrongs/android/pop/zeroconf/e;->k:[B

    :goto_0
    return-object v0
.end method

.method private e()Ljava/util/Map;
    .locals 9
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "[B>;"
        }
    .end annotation

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->m:Ljava/util/Map;

    if-nez v0, :cond_6

    invoke-direct {p0}, Lcom/estrongs/android/pop/zeroconf/f;->d()[B

    move-result-object v0

    if-eqz v0, :cond_6

    .line 2
    new-instance v0, Ljava/util/Hashtable;

    invoke-direct {v0}, Ljava/util/Hashtable;-><init>()V

    const/4 v1, 0x0

    const/4 v2, 0x0

    .line 3
    :goto_0
    :try_start_0
    invoke-direct {p0}, Lcom/estrongs/android/pop/zeroconf/f;->d()[B

    move-result-object v3

    array-length v3, v3

    if-ge v2, v3, :cond_5

    .line 4
    invoke-direct {p0}, Lcom/estrongs/android/pop/zeroconf/f;->d()[B

    move-result-object v3

    add-int/lit8 v4, v2, 0x1

    aget-byte v2, v3, v2

    and-int/lit16 v2, v2, 0xff

    if-eqz v2, :cond_4

    add-int v3, v4, v2

    .line 5
    invoke-direct {p0}, Lcom/estrongs/android/pop/zeroconf/f;->d()[B

    move-result-object v5

    array-length v5, v5

    if-le v3, v5, :cond_0

    goto :goto_3

    :cond_0
    const/4 v5, 0x0

    :goto_1
    if-ge v5, v2, :cond_1

    .line 6
    invoke-direct {p0}, Lcom/estrongs/android/pop/zeroconf/f;->d()[B

    move-result-object v6

    add-int v7, v4, v5

    aget-byte v6, v6, v7
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    const/16 v7, 0x3d

    if-eq v6, v7, :cond_1

    add-int/lit8 v5, v5, 0x1

    goto :goto_1

    :cond_1
    const/4 v6, 0x0

    .line 7
    :try_start_1
    new-instance v7, Ljava/lang/String;

    invoke-direct {p0}, Lcom/estrongs/android/pop/zeroconf/f;->d()[B

    move-result-object v8

    invoke-direct {v7, v8, v4, v5}, Ljava/lang/String;-><init>([BII)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    move-object v6, v7

    goto :goto_2

    :catch_0
    move-exception v7

    .line 8
    :try_start_2
    invoke-virtual {v7}, Ljava/lang/Exception;->printStackTrace()V

    :goto_2
    if-nez v6, :cond_2

    .line 9
    invoke-virtual {v0}, Ljava/util/Hashtable;->clear()V

    goto :goto_4

    :cond_2
    if-ne v5, v2, :cond_3

    .line 10
    sget-object v2, Lcom/estrongs/android/pop/zeroconf/f;->o:[B

    invoke-virtual {v0, v6, v2}, Ljava/util/Hashtable;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    move v2, v4

    goto :goto_0

    :cond_3
    add-int/lit8 v5, v5, 0x1

    sub-int/2addr v2, v5

    .line 11
    new-array v7, v2, [B

    .line 12
    invoke-direct {p0}, Lcom/estrongs/android/pop/zeroconf/f;->d()[B

    move-result-object v8

    add-int/2addr v4, v5

    invoke-static {v8, v4, v7, v1, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 13
    invoke-virtual {v0, v6, v7}, Ljava/util/Hashtable;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    move v2, v3

    goto :goto_0

    .line 14
    :cond_4
    :goto_3
    invoke-virtual {v0}, Ljava/util/Hashtable;->clear()V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    .line 15
    :catch_1
    :cond_5
    :goto_4
    iput-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->m:Ljava/util/Map;

    .line 16
    :cond_6
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->m:Ljava/util/Map;

    if-eqz v0, :cond_7

    goto :goto_5

    :cond_7
    invoke-static {}, Ljava/util/Collections;->emptyMap()Ljava/util/Map;

    move-result-object v0

    :goto_5
    return-object v0
.end method


# virtual methods
.method public a()Ljava/lang/String;
    .locals 4

    .line 38
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->m:Ljava/util/Map;

    const/4 v1, 0x0

    if-eqz v0, :cond_1

    invoke-interface {v0}, Ljava/util/Map;->size()I

    move-result v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->m:Ljava/util/Map;

    const-string v2, "path"

    invoke-interface {v0, v2}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    goto :goto_0

    .line 39
    :cond_0
    :try_start_0
    new-instance v0, Ljava/lang/String;

    iget-object v3, p0, Lcom/estrongs/android/pop/zeroconf/f;->m:Ljava/util/Map;

    invoke-interface {v3, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, [B

    invoke-direct {v0, v2}, Ljava/lang/String;-><init>([B)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-object v1, v0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 40
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    :cond_1
    :goto_0
    return-object v1
.end method

.method public a(Ljava/net/Inet4Address;)V
    .locals 0

    .line 33
    iput-object p1, p0, Lcom/estrongs/android/pop/zeroconf/f;->f:Ljava/net/Inet4Address;

    return-void
.end method

.method public a(Ljava/net/Inet6Address;)V
    .locals 0

    .line 34
    iput-object p1, p0, Lcom/estrongs/android/pop/zeroconf/f;->g:Ljava/net/Inet6Address;

    return-void
.end method

.method public a([B)V
    .locals 0

    if-nez p1, :cond_0

    return-void

    .line 36
    :cond_0
    iput-object p1, p0, Lcom/estrongs/android/pop/zeroconf/f;->l:[B

    .line 37
    invoke-direct {p0}, Lcom/estrongs/android/pop/zeroconf/f;->e()Ljava/util/Map;

    return-void
.end method

.method public b()Ljava/util/Map;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "[B>;"
        }
    .end annotation

    .line 8
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->m:Ljava/util/Map;

    return-object v0
.end method

.method public c()Z
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->f:Ljava/net/Inet4Address;

    if-nez v0, :cond_1

    iget-object v0, p0, Lcom/estrongs/android/pop/zeroconf/f;->g:Ljava/net/Inet6Address;

    if-eqz v0, :cond_0

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    goto :goto_1

    :cond_1
    :goto_0
    const/4 v0, 0x1

    :goto_1
    return v0
.end method

.method public equals(Ljava/lang/Object;)Z
    .locals 1

    .line 1
    instance-of v0, p1, Lcom/estrongs/android/pop/zeroconf/f;

    if-eqz v0, :cond_0

    check-cast p1, Lcom/estrongs/android/pop/zeroconf/f;

    invoke-direct {p0, p1}, Lcom/estrongs/android/pop/zeroconf/f;->a(Lcom/estrongs/android/pop/zeroconf/f;)Z

    move-result p1

    if-eqz p1, :cond_0

    const/4 p1, 0x1

    goto :goto_0

    :cond_0
    const/4 p1, 0x0

    :goto_0
    return p1
.end method
